package com.jimmy.medical.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * 剩余次数
 * 
 * @author jimmy
 * @since 0.1
 */
@Entity
@Table(name = "recharge")
public class Recharge extends AbstractEntity {
	private static final long serialVersionUID = 429312832148608091L;
	/** 充值会员*/
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "member_id")
    @NotFound(action = NotFoundAction.IGNORE)
    private Member member;
    /** 
     * 关联合同
     * 由于可以多个会员公用一个合同,充值剩余情况中的所属会员只能是第一个充值的会员
     * 因此必须保证合同和年费充值的一对一关系，会员查询剩余情况时就可以根据合同查询出来年费充值的剩余情况(一个会员只有一个有效合同)
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "contract_id")
    @NotFound(action = NotFoundAction.IGNORE)
	private Contract contract;
	/** 充值类型,年费或者普通续次*/
	@Column(name = "recharge_type", length = 10)
	private String rechargeType;

	/** 收费金额*/
	@Column(name = "money")
	private float money;

	/** 说明*/
	@Column(name = "description", length = 50)
	private String description;

	/** 是否开票*/
	@Column(name = "is_billing", length = 10)
	private String isBilling;
	
	/** 是否已开票*/
	@Column(name = "billed", length = 10)
	private String billed;
	
	/** 付款方式,1:现金;2:转账*/
	@Column(name = "payment_method", length = 10)
	private String paymentMethod;
	
	/** 已付,1:是;0:否*/
	@Column(name = "is_payed", length = 10)
	private String isPayed;

	/** 发票信息*/
	@Column(name = "billing_info", length = 100)
	private String billingInfo;
	
	/** 入会时间*/
	@Column(name = "begin_time", length = 20)
	private String beginTime;
	
	/** 会员周期*/
	@Column(name = "cycle")
	private Integer cycle;

	/** 到期时间*/
	@Column(name = "expire_time", length = 20)
	private String expireTime;
	
	/** 推荐人*/
	@Column(name = "recommend_by", length = 20)
	private String recommendBy;
	
	/** 收款人*/
	@Column(name = "payee", length = 20)
	private String payee;
	
	/** 审核人*/
	@Column(name = "approve_by", length = 20)
	private String approveBy;

	/** 付款状态,1:未付款;2:已付款;3:财务已审核*/
	@Column(name = "status", length = 10)
	private String status;

	@Column(name = "card_no", length = 50)
	private String cardNo;
	
	@Column(name = "card_type", length = 2)
	private String cardType;
	
	@Column(name = "passwd", length = 50)
	private String password;
	
	/** 体检完成时间*/
	@Column(name = "health_check_time", length = 20)
	private String healthCheckTime;
	
	@Column(name = "create_time", length = 20)
	private String createTime;
	@Column(name = "create_user", length = 50)
	private String createUser;
	@Column(name = "update_time")
	private String updateTime;
	@Column(name = "update_user", length = 20)
	private String updateUser;
	
	public Member getMember() {
		return member;
	}
	public void setMember(Member member) {
		this.member = member;
	}
	public Contract getContract() {
		return contract;
	}
	public void setContract(Contract contract) {
		this.contract = contract;
	}
	public String getRechargeType() {
		return rechargeType;
	}
	public void setRechargeType(String rechargeType) {
		this.rechargeType = rechargeType;
	}
	public String getIsPayed() {
		return isPayed;
	}
	public void setIsPayed(String isPayed) {
		this.isPayed = isPayed;
	}
	public float getMoney() {
		return money;
	}
	public void setMoney(float money) {
		this.money = money;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getIsBilling() {
		return isBilling;
	}
	public void setIsBilling(String isBilling) {
		this.isBilling = isBilling;
	}
	public String getBilled() {
		return billed;
	}
	public void setBilled(String billed) {
		this.billed = billed;
	}
	public String getPaymentMethod() {
		return paymentMethod;
	}
	public void setPaymentMethod(String paymentMethod) {
		this.paymentMethod = paymentMethod;
	}
	public String getBillingInfo() {
		return billingInfo;
	}
	public void setBillingInfo(String billingInfo) {
		this.billingInfo = billingInfo;
	}
	public String getBeginTime() {
		return beginTime;
	}
	public void setBeginTime(String beginTime) {
		this.beginTime = beginTime;
	}
	public Integer getCycle() {
		return cycle;
	}
	public void setCycle(Integer cycle) {
		this.cycle = cycle;
	}
	public String getExpireTime() {
		return expireTime;
	}
	public void setExpireTime(String expireTime) {
		this.expireTime = expireTime;
	}
	public String getRecommendBy() {
		return recommendBy;
	}
	public void setRecommendBy(String recommendBy) {
		this.recommendBy = recommendBy;
	}
	public String getPayee() {
		return payee;
	}
	public void setPayee(String payee) {
		this.payee = payee;
	}
	public String getApproveBy() {
		return approveBy;
	}
	public void setApproveBy(String approveBy) {
		this.approveBy = approveBy;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getCardNo() {
		return cardNo;
	}
	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}
	public String getCardType() {
		return cardType;
	}
	public void setCardType(String cardType) {
		this.cardType = cardType;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getHealthCheckTime() {
		return healthCheckTime;
	}
	public void setHealthCheckTime(String healthCheckTime) {
		this.healthCheckTime = healthCheckTime;
	}
	public String getCreateTime() {
		return createTime;
	}
	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}
	public String getCreateUser() {
		return createUser;
	}
	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	public String getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}
	public String getUpdateUser() {
		return updateUser;
	}
	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}
}
